package com.anxinr.service.impl;

import com.anxinr.mapper.CookieMapper;
import com.anxinr.pojo.entity.Cookie;
import com.anxinr.service.ICookieService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * @author anxinr
 */
@Service
public class ICookieServiceImpl extends ServiceImpl<CookieMapper, Cookie> implements ICookieService {
    @Override
    public Page<Cookie> queryUsers(Cookie cookie) {
        Page<Cookie> page = new Page<>(cookie.getPage(), cookie.getSize());
        LambdaQueryWrapper<Cookie> wrapper = new LambdaQueryWrapper<>();
        wrapper.like(StringUtils.isNotBlank(cookie.getCokey()),Cookie::getCokey,cookie.getCokey());
        return this.page(page,wrapper);
    }
}
